<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>帖子详情 - 社交论坛</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    :root {
      --primary: #5B7BDF;
      --primary-light: #E8EBFA;
      --secondary: #FF7D54;
      --success: #4CAF50;
      --warning: #FFC107;
      --danger: #F44336;
      --text-primary: #1D2129;
      --text-secondary: #86909C;
      --bg-light: #F2F3F5;
      --bg-white: #FFFFFF;
      --border-light: #E5E6EB;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: var(--bg-light);
      color: var(--text-primary);
      line-height: 1.6;
      font-size: 15px;
      padding-bottom: 70px;
    }
    
    /* 顶部导航 */
    .navbar {
      background-color: var(--primary);
      color: white;
      padding: 0.75rem 1rem;
    }
    
    .navbar-nav .nav-link {
      color: rgba(255, 255, 255, 0.9);
      padding: 0.5rem 0.75rem;
    }
    
    .navbar-nav .nav-link.active {
      color: white;
      font-weight: 500;
    }
    
    /* 帖子容器 */
    .post-container {
      background-color: var(--bg-white);
      margin-bottom: 10px;
    }
    
    /* 帖子头部 */
    .post-header {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .post-author {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .author-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .author-info {
      flex: 1;
    }
    
    .author-name {
      font-weight: 600;
      font-size: 16px;
    }
    
    .post-meta {
      display: flex;
      font-size: 12px;
      color: var(--text-secondary);
      gap: 10px;
    }
    
    .post-menu {
      color: var(--text-secondary);
    }
    
    /* 帖子内容 */
    .post-content {
      padding: 15px;
      font-size: 16px;
      line-height: 1.7;
    }
    
    .post-media {
      width: 100%;
      margin: 10px 0;
      border-radius: 8px;
      overflow: hidden;
    }
    
    .post-image {
      width: 100%;
      height: auto;
      display: block;
    }
    
    /* 帖子标签 */
    .post-tags {
      padding: 0 15px 15px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    
    .post-tag {
      padding: 4px 10px;
      background-color: var(--primary-light);
      color: var(--primary);
      border-radius: 16px;
      font-size: 13px;
    }
    
    /* 帖子操作栏 */
    .post-actions {
      display: flex;
      padding: 10px 0;
      border-top: 1px solid var(--border-light);
      border-bottom: 1px solid var(--border-light);
    }
    
    .action-button {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
      background: none;
      border: none;
      font-size: 12px;
      gap: 4px;
      padding: 5px 0;
    }
    
    .action-button.active {
      color: var(--primary);
    }
    
    .action-icon {
      font-size: 18px;
    }
    
    /* 内容样式切换器 */
    .content-style-switch {
      background-color: var(--bg-white);
      padding: 10px 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border-light);
    }
    
    .style-label {
      font-size: 14px;
      color: var(--text-secondary);
    }
    
    .style-options {
      display: flex;
      gap: 10px;
    }
    
    .style-option {
      width: 30px;
      height: 30px;
      border-radius: 6px;
      border: 1px solid var(--border-light);
      background-color: var(--bg-white);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
    }
    
    .style-option.active {
      background-color: var(--primary);
      color: white;
      border-color: var(--primary);
    }
    
    /* 评论区 */
    .comments-section {
      background-color: var(--bg-white);
      margin-bottom: 10px;
    }
    
    .comments-header {
      padding: 15px;
      font-weight: 600;
      border-bottom: 1px solid var(--border-light);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .comments-count {
      color: var(--text-secondary);
      font-weight: normal;
      font-size: 14px;
    }
    
    /* 评论输入框 */
    .comment-input-container {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .comment-input-wrapper {
      display: flex;
      gap: 10px;
    }
    
    .comment-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .comment-input-box {
      flex: 1;
      position: relative;
    }
    
    .comment-input {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border-light);
      border-radius: 20px;
      font-size: 14px;
      resize: none;
      height: 40px;
      overflow: hidden;
    }
    
    .comment-input:focus {
      outline: none;
      border-color: var(--primary);
    }
    
    .comment-actions {
      display: none;
      position: absolute;
      right: 10px;
      bottom: -35px;
      gap: 10px;
    }
    
    .comment-input:focus ~ .comment-actions {
      display: flex;
    }
    
    .comment-action-btn {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: none;
      background-color: var(--bg-light);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .send-comment {
      background-color: var(--primary);
      color: white;
    }
    
    /* 评论列表 */
    .comments-list {
      margin: 0;
      padding: 0;
      list-style: none;
    }
    
    /* 评论项 - 标准样式 */
    .comment-item {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .comment-header {
      display: flex;
      gap: 10px;
      margin-bottom: 8px;
    }
    
    .comment-author-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .comment-author-info {
      flex: 1;
    }
    
    .comment-author-name {
      font-weight: 500;
      font-size: 14px;
    }
    
    .comment-time {
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .comment-content {
      font-size: 15px;
      margin-bottom: 8px;
      padding-left: 46px; /* 头像宽度 + 间距 */
    }
    
    .comment-actions {
      display: flex;
      gap: 15px;
      padding-left: 46px;
      font-size: 13px;
    }
    
    .comment-action {
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 4px;
    }
    
    .comment-action.active {
      color: var(--primary);
    }
    
    /* 紧凑样式评论 */
    .comments-compact .comment-item {
      padding: 10px 15px;
    }
    
    .comments-compact .comment-content {
      font-size: 14px;
      margin-bottom: 5px;
    }
    
    .comments-compact .comment-actions {
      font-size: 12px;
      gap: 10px;
    }
    
    /* 气泡样式评论 */
    .comments-bubble .comment-item {
      padding: 15px;
      border-bottom: none;
    }
    
    .comments-bubble .comment-inner {
      display: flex;
      gap: 10px;
    }
    
    .comments-bubble .comment-content {
      background-color: var(--bg-light);
      padding: 10px 15px;
      border-radius: 18px;
      border-top-left-radius: 4px;
      margin-bottom: 5px;
      padding-left: 15px;
      max-width: calc(100% - 46px);
    }
    
    .comments-bubble .comment-actions {
      padding-left: 46px;
      font-size: 12px;
    }
    
    /* 回复样式 */
    .replies-list {
      margin: 0;
      padding: 0 0 0 46px;
      list-style: none;
    }
    
    .reply-item {
      padding: 8px 0;
    }
    
    .reply-content {
      font-size: 14px;
      background-color: var(--bg-light);
      padding: 8px 12px;
      border-radius: 12px;
      margin-bottom: 5px;
    }
    
    .reply-author {
      font-weight: 500;
      color: var(--primary);
    }
    
    .reply-actions {
      display: flex;
      gap: 15px;
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    /* 加载更多 */
    .load-more {
      padding: 15px;
      text-align: center;
      color: var(--primary);
      font-size: 14px;
      cursor: pointer;
    }
    
    /* 底部操作栏 */
    .bottom-action-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: var(--bg-white);
      border-top: 1px solid var(--border-light);
      display: flex;
      padding: 8px 15px;
      gap: 10px;
    }
    
    .bottom-action {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px 0;
      border-radius: 8px;
      background-color: var(--bg-light);
      color: var(--text-primary);
      font-size: 14px;
      gap: 5px;
      text-decoration: none;
    }
    
    .bottom-action.primary {
      background-color: var(--primary);
      color: white;
    }
    
    /* 点赞动画 */
    @keyframes likePulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.3); }
      100% { transform: scale(1); }
    }
    
    .like-animation {
      animation: likePulse 0.3s ease;
    }
    
    /* 提示消息 */
    .toast {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      background-color: rgba(0, 0, 0, 0.7);
      color: white;
      padding: 6px 12px;
      border-radius: 4px;
      font-size: 14px;
      z-index: 1000;
      display: none;
    }
  </style>
</head>
<body>
  <!-- 顶部导航 -->
  <nav class="navbar navbar-expand">
    <div class="container-fluid">
      <ul class="navbar-nav w-100 justify-content-between">
        <li class="nav-item">
          <a class="nav-link" href="#" aria-label="返回">
            <i class="fa fa-arrow-left"></i>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link active" href="#">帖子详情</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#" aria-label="分享">
            <i class="fa fa-share-alt"></i>
          </a>
        </li>
      </ul>
    </div>
  </nav>
  
  <!-- 帖子容器 -->
  <div class="post-container">
    <!-- 帖子头部 -->
    <div class="post-header">
      <div class="post-author">
        <img src="https://picsum.photos/200/200?random=1" alt="作者头像" class="author-avatar">
        <div class="author-info">
          <div class="author-name">李思成</div>
          <div class="post-meta">
            <span>技术交流论坛</span>
            <span>今天 09:24</span>
          </div>
        </div>
      </div>
      <div class="post-menu">
        <i class="fa fa-ellipsis-v"></i>
      </div>
    </div>
    
    <!-- 帖子内容 -->
    <div class="post-content">
      最近在项目中升级到了React 18，发现了很多实用的新特性，特别是并发渲染和自动批处理更新机制，大大提升了应用性能。本文将详细介绍这些新特性的使用方法和实际应用场景。<br><br>

      React 18的主要新特性包括：<br>
      1. 自动批处理更新（Automatic Batching）<br>
      2. 并发渲染（Concurrent Rendering）<br>
      3. 过渡API（Transitions）<br>
      4. 服务器组件（Server Components）<br><br>

      其中，自动批处理更新对现有项目的性能提升最为明显，无需修改代码即可减少不必要的渲染次数...
    </div>
    
    <!-- 帖子图片 -->
    <div class="post-media">
      <img src="https://picsum.photos/800/400?random=101" alt="React 18特性图示" class="post-image">
    </div>
    
    <!-- 帖子标签 -->
    <div class="post-tags">
      <span class="post-tag">React</span>
      <span class="post-tag">前端开发</span>
      <span class="post-tag">JavaScript</span>
      <span class="post-tag">性能优化</span>
    </div>
    
    <!-- 帖子操作栏 -->
    <div class="post-actions">
      <button class="action-button" id="likeButton">
        <i class="fa fa-heart-o action-icon"></i>
        <span>点赞 (324)</span>
      </button>
      <button class="action-button" id="commentButton">
        <i class="fa fa-comment-o action-icon"></i>
        <span>评论 (86)</span>
      </button>
      <button class="action-button" id="collectButton">
        <i class="fa fa-star-o action-icon"></i>
        <span>收藏</span>
      </button>
      <button class="action-button" id="shareButton">
        <i class="fa fa-share-alt action-icon"></i>
        <span>分享</span>
      </button>
    </div>
  </div>
  
  <!-- 内容样式切换器 -->
  <div class="content-style-switch">
    <span class="style-label">评论样式：</span>
    <div class="style-options">
      <button class="style-option active" data-style="standard" title="标准样式">
        <i class="fa fa-list"></i>
      </button>
      <button class="style-option" data-style="compact" title="紧凑样式">
        <i class="fa fa-align-left"></i>
      </button>
      <button class="style-option" data-style="bubble" title="气泡样式">
        <i class="fa fa-comment"></i>
      </button>
    </div>
  </div>
  
  <!-- 评论区 -->
  <div class="comments-section" id="commentsSection">
    <div class="comments-header">
      评论区
      <span class="comments-count">86条评论</span>
    </div>
    
    <!-- 评论输入框 -->
    <div class="comment-input-container">
      <div class="comment-input-wrapper">
        <img src="https://picsum.photos/200/200?random=99" alt="你的头像" class="comment-avatar">
        <div class="comment-input-box">
          <textarea class="comment-input" placeholder="分享你的想法..."></textarea>
          <div class="comment-actions">
            <button class="comment-action-btn" title="添加图片">
              <i class="fa fa-image"></i>
            </button>
            <button class="comment-action-btn" title="添加表情">
              <i class="fa fa-smile-o"></i>
            </button>
            <button class="comment-action-btn send-comment" title="发送">
              <i class="fa fa-paper-plane"></i>
            </button>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 评论列表 -->
    <ul class="comments-list" id="commentsList">
      <!-- 评论1 -->
      <li class="comment-item">
        <div class="comment-header">
          <img src="https://picsum.photos/200/200?random=2" alt="评论者头像" class="comment-author-avatar">
          <div class="comment-author-info">
            <div class="comment-author-name">张开发</div>
            <div class="comment-time">今天 10:15</div>
          </div>
        </div>
        <div class="comment-content">
          非常实用的分享！我最近也在研究React 18的新特性，特别是并发渲染对复杂表单的优化效果很明显。请问你在项目中遇到过什么兼容性问题吗？
        </div>
        <div class="comment-actions">
          <div class="comment-action like-comment">
            <i class="fa fa-heart-o"></i> 42
          </div>
          <div class="comment-action reply-comment">
            <i class="fa fa-reply"></i> 回复
          </div>
        </div>
        
        <!-- 回复列表 -->
        <ul class="replies-list">
          <li class="reply-item">
            <div class="reply-content">
              <span class="reply-author">李思成</span> 回复 <span class="reply-author">张开发</span>：
              主要遇到了一些第三方库的兼容性问题，特别是一些自定义hooks。建议升级前先检查项目依赖，官方有一个兼容列表可以参考。
            </div>
            <div class="reply-actions">
              <div class="reply-action like-reply">
                <i class="fa fa-heart-o"></i> 18
              </div>
              <div class="reply-action reply-reply">
                <i class="fa fa-reply"></i> 回复
              </div>
            </div>
          </li>
        </ul>
      </li>
      
      <!-- 评论2 -->
      <li class="comment-item">
        <div class="comment-header">
          <img src="https://picsum.photos/200/200?random=3" alt="评论者头像" class="comment-author-avatar">
          <div class="comment-author-info">
            <div class="comment-author-name">王程序</div>
            <div class="comment-time">今天 09:45</div>
          </div>
        </div>
        <div class="comment-content">
          关于自动批处理更新，我做了一些测试，在处理大量状态更新时性能提升大约在30%左右，确实很显著。
        </div>
        <div class="comment-actions">
          <div class="comment-action like-comment">
            <i class="fa fa-heart-o"></i> 27
          </div>
          <div class="comment-action reply-comment">
            <i class="fa fa-reply"></i> 回复
          </div>
        </div>
      </li>
      
      <!-- 评论3 -->
      <li class="comment-item">
        <div class="comment-header">
          <img src="https://picsum.photos/200/200?random=4" alt="评论者头像" class="comment-author-avatar">
          <div class="comment-author-info">
            <div class="comment-author-name">赵前端</div>
            <div class="comment-time">昨天 23:12</div>
          </div>
        </div>
        <div class="comment-content">
          请问过渡API（Transitions）在实际项目中是如何应用的？有没有什么需要注意的地方？
        </div>
        <div class="comment-actions">
          <div class="comment-action like-comment">
            <i class="fa fa-heart-o"></i> 15
          </div>
          <div class="comment-action reply-comment">
            <i class="fa fa-reply"></i> 回复
          </div>
        </div>
        
        <!-- 回复列表 -->
        <ul class="replies-list">
          <li class="reply-item">
            <div class="reply-content">
              <span class="reply-author">李思成</span> 回复 <span class="reply-author">赵前端</span>：
              过渡API非常适合处理搜索场景，当用户输入搜索关键词时，可以将结果渲染标记为非紧急更新，保持输入框的响应性。
            </div>
            <div class="reply-actions">
              <div class="reply-action like-reply">
                <i class="fa fa-heart-o"></i> 9
              </div>
              <div class="reply-action reply-reply">
                <i class="fa fa-reply"></i> 回复
              </div>
            </div>
          </li>
          <li class="reply-item">
            <div class="reply-content">
              <span class="reply-author">张开发</span> 回复 <span class="reply-author">赵前端</span>：
              补充一点，使用时要注意区分useTransition和startTransition的适用场景，避免过度使用导致性能问题。
            </div>
            <div class="reply-actions">
              <div class="reply-action like-reply">
                <i class="fa fa-heart-o"></i> 5
              </div>
              <div class="reply-action reply-reply">
                <i class="fa fa-reply"></i> 回复
              </div>
            </div>
          </li>
        </ul>
      </li>
    </ul>
    
    <!-- 加载更多 -->
    <div class="load-more">
      加载更多评论
    </div>
  </div>
  
  <!-- 底部操作栏 -->
  <div class="bottom-action-bar">
    <a href="#" class="bottom-action" id="reportButton">
      <i class="fa fa-flag-o"></i>
      <span>举报</span>
    </a>
    <a href="#" class="bottom-action primary" id="followButton">
      <i class="fa fa-plus"></i>
      <span>关注作者</span>
    </a>
  </div>
  
  <!-- 提示消息 -->
  <div class="toast" id="toast"></div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 获取DOM元素
    const likeButton = document.getElementById('likeButton');
    const commentButton = document.getElementById('commentButton');
    const collectButton = document.getElementById('collectButton');
    const shareButton = document.getElementById('shareButton');
    const followButton = document.getElementById('followButton');
    const reportButton = document.getElementById('reportButton');
    const toast = document.getElementById('toast');
    const styleOptions = document.querySelectorAll('.style-option');
    const commentsSection = document.getElementById('commentsSection');
    const commentInput = document.querySelector('.comment-input');
    const sendCommentBtn = document.querySelector('.send-comment');
    
    // 显示提示消息
    function showToast(message) {
      toast.textContent = message;
      toast.style.display = 'block';
      
      setTimeout(() => {
        toast.style.display = 'none';
      }, 2000);
    }
    
    // 点赞功能
    likeButton.addEventListener('click', function() {
      const icon = this.querySelector('i');
      const text = this.querySelector('span');
      
      if (icon.classList.contains('fa-heart-o')) {
        icon.classList.replace('fa-heart-o', 'fa-heart');
        this.classList.add('active');
        icon.classList.add('like-animation');
        text.textContent = '点赞 (325)';
        showToast('点赞成功');
        
        setTimeout(() => {
          icon.classList.remove('like-animation');
        }, 300);
      } else {
        icon.classList.replace('fa-heart', 'fa-heart-o');
        this.classList.remove('active');
        text.textContent = '点赞 (324)';
        showToast('取消点赞');
      }
    });
    
    // 评论按钮点击事件 - 滚动到评论区
    commentButton.addEventListener('click', function() {
      document.querySelector('.comment-input-container').scrollIntoView({
        behavior: 'smooth'
      });
      commentInput.focus();
    });
    
    // 收藏功能
    collectButton.addEventListener('click', function() {
      const icon = this.querySelector('i');
      const text = this.querySelector('span');
      
      if (icon.classList.contains('fa-star-o')) {
        icon.classList.replace('fa-star-o', 'fa-star');
        this.classList.add('active');
        text.textContent = '已收藏';
        showToast('收藏成功');
      } else {
        icon.classList.replace('fa-star', 'fa-star-o');
        this.classList.remove('active');
        text.textContent = '收藏';
        showToast('取消收藏');
      }
    });
    
    // 分享功能
    shareButton.addEventListener('click', function() {
      showToast('分享功能待实现');
    });
    
    // 关注作者
    followButton.addEventListener('click', function() {
      const icon = this.querySelector('i');
      const text = this.querySelector('span');
      
      if (icon.classList.contains('fa-plus')) {
        icon.classList.replace('fa-plus', 'fa-check');
        text.textContent = '已关注';
        showToast('关注成功');
      } else {
        icon.classList.replace('fa-check', 'fa-plus');
        text.textContent = '关注作者';
        showToast('取消关注');
      }
    });
    
    // 举报功能
    reportButton.addEventListener('click', function() {
      if (confirm('确定要举报此帖子吗？')) {
        showToast('举报已提交，感谢你的反馈');
      }
    });
    
    // 切换评论样式
    styleOptions.forEach(option => {
      option.addEventListener('click', function() {
        // 移除所有选项的活跃状态
        styleOptions.forEach(opt => opt.classList.remove('active'));
        // 添加当前选项的活跃状态
        this.classList.add('active');
        
        // 移除所有评论样式类
        commentsSection.classList.remove('comments-standard', 'comments-compact', 'comments-bubble');
        // 添加当前样式类
        commentsSection.classList.add(`comments-${this.getAttribute('data-style')}`);
      });
    });
    
    // 评论输入框自动调整高度
    commentInput.addEventListener('input', function() {
      this.style.height = 'auto';
      // 限制最大高度为120px
      this.style.height = Math.min(this.scrollHeight, 120) + 'px';
    });
    
    // 发送评论
    sendCommentBtn.addEventListener('click', function() {
      const commentText = commentInput.value.trim();
      if (commentText) {
        showToast('评论发表成功');
        commentInput.value = '';
        commentInput.style.height = '40px';
      } else {
        showToast('请输入评论内容');
      }
    });
    
    // 评论点赞功能
    document.querySelectorAll('.like-comment').forEach(likeBtn => {
      likeBtn.addEventListener('click', function() {
        const icon = this.querySelector('i');
        let countText = this.textContent.trim().split(' ')[1];
        let count = parseInt(countText);
        
        if (icon.classList.contains('fa-heart-o')) {
          icon.classList.replace('fa-heart-o', 'fa-heart');
          this.classList.add('active');
          icon.classList.add('like-animation');
          this.innerHTML = `<i class="fa fa-heart"></i> ${count + 1}`;
          showToast('点赞成功');
        } else {
          icon.classList.replace('fa-heart', 'fa-heart-o');
          this.classList.remove('active');
          this.innerHTML = `<i class="fa fa-heart-o"></i> ${count - 1}`;
          showToast('取消点赞');
        }
        
        setTimeout(() => {
          icon.classList.remove('like-animation');
        }, 300);
      });
    });
    
    // 回复点赞功能
    document.querySelectorAll('.like-reply').forEach(likeBtn => {
      likeBtn.addEventListener('click', function() {
        const icon = this.querySelector('i');
        let countText = this.textContent.trim().split(' ')[1];
        let count = parseInt(countText);
        
        if (icon.classList.contains('fa-heart-o')) {
          icon.classList.replace('fa-heart-o', 'fa-heart');
          this.classList.add('active');
          icon.classList.add('like-animation');
          this.innerHTML = `<i class="fa fa-heart"></i> ${count + 1}`;
          showToast('点赞成功');
        } else {
          icon.classList.replace('fa-heart', 'fa-heart-o');
          this.classList.remove('active');
          this.innerHTML = `<i class="fa fa-heart-o"></i> ${count - 1}`;
          showToast('取消点赞');
        }
        
        setTimeout(() => {
          icon.classList.remove('like-animation');
        }, 300);
      });
    });
    
    // 回复功能
    document.querySelectorAll('.reply-comment, .reply-reply').forEach(replyBtn => {
      replyBtn.addEventListener('click', function() {
        const authorName = this.closest('.comment-item, .reply-item')
          .querySelector('.comment-author-name, .reply-author').textContent;
        
        commentInput.value = `回复 @${authorName}：`;
        commentInput.style.height = 'auto';
        commentInput.style.height = Math.min(commentInput.scrollHeight, 120) + 'px';
        
        document.querySelector('.comment-input-container').scrollIntoView({
          behavior: 'smooth'
        });
        commentInput.focus();
      });
    });
    
    // 加载更多评论
    document.querySelector('.load-more').addEventListener('click', function() {
      this.textContent = '加载中...';
      
      // 模拟加载延迟
      setTimeout(() => {
        this.textContent = '没有更多评论了';
        this.style.color = var(--text-secondary);
        this.style.cursor = 'default';
      }, 1500);
    });
  </script>
</body>
</html>
